&lt;template&gt;
  &lt;div class="task-card"&gt;
    &lt;div class="task-header"&gt;
      &lt;h4&gt;{{ task.title }}&lt;/h4&gt;
      &lt;el-tag size="small" :type="task.difficulty === 'easy' ? 'success' : task.difficulty === 'medium' ? 'warning' : 'danger'"&gt;
        {{ task.difficulty }}
      &lt;/el-tag&gt;
    &lt;/div&gt;
    &lt;p class="task-description"&gt;{{ task.description }}&lt;/p&gt;
    &lt;div class="task-footer"&gt;
      &lt;span class="reward"&gt;奖励: {{ task.reward }}&lt;/span&gt;
      &lt;el-button type="primary" size="small" @click="$emit('select', task)"&gt;开始任务&lt;/el-button&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/template&gt;

&lt;script setup&gt;
defineProps({
  task: {
    type: Object,
    required: true
  }
})

defineEmits(['select'])
&lt;/script&gt;

&lt;style scoped&gt;
.task-card {
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 16px;
  background-color: #fff;
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.task-header h4 {
  margin: 0;
}

.task-description {
  color: #606266;
  margin: 8px 0;
}

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.reward {
  color: #67c23a;
  font-weight: bold;
}
&lt;/style&gt;
